package daily.may0527;

import java.util.ArrayList;

public class UseStreamTraverseTest {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("张无忌");
        list.add("周芷若");
        list.add("赵敏");
        list.add("张强");
        list.add("张三丰");
        list.stream()//获取Stream流
                .filter(s -> s.startsWith("张"))//过滤姓张
                .filter(s -> s.length() == 3)//过滤3个字的
                .forEach(name -> System.out.println(name));//打印
    }
}